package
{
	import org.flixel.FlxSprite;
	import org.flixel.FlxG;
	
	public class LightSource extends PlumeSource
	{
		public function LightSource(_x:int, _y:int, lA:FlxSprite, isOn:Boolean=false)
		{
			super(_x, _y, lA, null);
			m_element = Elemental.LIGHT;
			addAnimation("on", [0,1,2,3], 4);
			addAnimation("off", [0], 1);
			play("off");
			loadGraphic(Res.LightOffSource, true, false, 46, 46, false);
		}
		
		public override function update():void {
			super.update();
		}
		
		public override function turnOff():void {
			super.turnOff();
			play("off");
			loadGraphic(Res.LightOffSource, false, false, 46, 46, false);
		}
		
		public override function turnOn():void {
			super.turnOn();
			lightingAnimator.loadGraphic(Res.lightLightAnim, true, false, 92, 92, false);
			lightingAnimator.play("lightOn");
			
			play("on");
			loadGraphic(Res.LightOnSource, true, false, 46, 46, false);
			if (!Music.MUTE){
				FlxG.play(Res.LightSound);
			}
		}
	}
}